//
// Buttons
// --------------------------------------------------


// Base styles
// --------------------------------------------------

// Core
.btn {
  display: inline-block;
  .ie7-inline-block();
  padding: 3px 12px 7px;
  margin-bottom: 0; // For input.btn
  .box-sizing(border-box);
  height: 2.142em;
  
  font-family: @sansFontFamily;
  font-size: @baseFontSize;

  min-width: 6em;
  line-height: @baseLineHeight;
  *line-height: @baseLineHeight;

  text-align: center;
  vertical-align: middle;
  cursor: pointer;

  .buttonBackground(@btnBackground, @btnBackgroundHighlight, @btnText);
  border: 0 none;
  *border: 0; // Remove the border to prevent IE7's black border on input:focus
  .ie7-restore-left-whitespace(); // Give IE7 some love


  // Hover state
  &:hover {
    color: @btnText;
    text-decoration: none;
    background-color: @btnBackgroundHighlight;
    *background-color: darken(@btnBackgroundHighlight, 5%); /* Buttons in IE7 don't get borders, so darken on hover */
  }

  // Focus state for keyboard and accessibility
  &:focus {
    .tab-focus();
  }

  // Active state
  &.active,
  &:active {
    background-color: darken(@btnBackgroundHighlight, 10%);
    background-color: darken(@btnBackgroundHighlight, 15%) e("\9");
    background-image: none;
    outline: 0;
  }

  // Disabled state
  &.disabled,
  &[disabled] {
    cursor: default;
    background-color: darken(@white, 10%);
    background-image: none;
    .opacity(65);
  }

	[class^="icon-"], [class*=" icon-"]  {
		vertical-align: middle;
		margin-top: -2px;
		margin-right: 4px;
	}
}

// Button Sizes
// --------------------------------------------------

// Large
.btn-large {
  padding: 8px 20px 14px;
  font-size: @baseFontSize + 6px;
  line-height: @baseLineHeight;
  font-weight: 100;
}


// Small
.btn-small {
  padding: 3px 9px 5px;
  font-size: @baseFontSize - 2px;
  line-height: @baseLineHeight - 2px;
}
.btn-small [class^="icon-"] {
  margin-top: 0;
}

// Mini
.btn-mini {
  padding: 2px 6px 5px;
  font-size: @baseFontSize - 3px;
  line-height: @baseLineHeight - 3px;
}


// Block button
// -------------------------

.btn-block {
  display: block;
  width: 100%;
  padding-left: 0;
  padding-right: 0;
}

// Vertically space out multiple block buttons
.btn-block + .btn-block {
  margin-top: 5px;
}

// Specificity overrides
input[type="submit"],
input[type="reset"],
input[type="button"],
button {

  &.btn-block {
    width: 100%;
  }
}



// Alternate buttons
// --------------------------------------------------

// Provide *some* extra contrast for those who can get it
.btn-primary.active,
.btn-warning.active,
.btn-danger.active,
.btn-success.active,
.btn-info.active,
.btn-inverse.active {
  color: @white;
}

// Set the backgrounds
// -------------------------
.btn-primary {
  .buttonBackground(@btnPrimaryBackground, @btnPrimaryBackgroundHighlight);
}
// Warning appears are orange
.btn-warning {
  .buttonBackground(@btnWarningBackground, @btnWarningBackgroundHighlight);
}
// Danger and error appear as red
.btn-danger {
  .buttonBackground(@btnDangerBackground, @btnDangerBackgroundHighlight);
}
// Success appears as green
.btn-success {
  .buttonBackground(@btnSuccessBackground, @btnSuccessBackgroundHighlight);
}
// Info appears as a neutral blue
.btn-info {
  .buttonBackground(@btnInfoBackground, @btnInfoBackgroundHighlight);
}
// Inverse appears as dark gray
.btn-inverse {
  .buttonBackground(@btnInverseBackground, @btnInverseBackgroundHighlight);
}

// Cross-browser Jank
// --------------------------------------------------

button.btn,
input[type="submit"].btn {

  // Firefox 3.6 only I believe
  &::-moz-focus-inner {
    padding: 0;
    border: 0;
  }

  // IE7 has some default padding on button controls
  *padding-top: 3px;
  *padding-bottom: 3px;

  &.btn-large {
    *padding-top: 7px;
    *padding-bottom: 7px;
  }
  &.btn-small {
    *padding-top: 3px;
    *padding-bottom: 3px;
  }
  &.btn-mini {
    *padding-top: 1px;
    *padding-bottom: 1px;
  }
}


// Link buttons
// --------------------------------------------------

// Make a button look and behave like a link
.btn-link,
.btn-link:active,
.btn-link[disabled] {
  background-color: transparent;
  background-image: none;
  min-width: 0;
  padding: 0;
  height: auto;
}
.btn-link {
  border-color: transparent;
  cursor: pointer;
  color: @linkColor;
}
.btn-link:hover {
  color: @linkColorHover;
  text-decoration: underline;
  background-color: transparent;
}
.btn-link[disabled]:hover {
  color: @grayDark;
  text-decoration: none;
}

// Striped buttons
// --------------------------------------------------

[class*=btn-striped] {
	border-style: solid;
	border-width: 0;
}

.btn-striped {
	.stripedButtonBorders(@mainAccentColor, @mainAccentHighlight);
}

.btn-striped-gray {
	.stripedButtonBorders(@grayLight, @mainAccentHighlight);
}

.btn-striped-pink {
	.stripedButtonBorders(@accentPink, @accentPinkHighlight);
}

.btn-striped-dark-red {
	.stripedButtonBorders(@accentDarkRed, @accentDarkRedHighlight);
}

.btn-striped-dark-orange {
	.stripedButtonBorders(@accentDarkOrange, @accentDarkOrangeHighlight);
}

.btn-striped-orange {
	.stripedButtonBorders(@accentOrange, @accentOrangeHighlight);
}

.btn-striped-light-green {
	.stripedButtonBorders(@accentLightGreen, @accentLightGreenHighlight);
}

.btn-striped-green {
	.stripedButtonBorders(@accentGreen, @accentGreenHighlight);
}

.btn-striped-light-teal {
	.stripedButtonBorders(@accentLightTeal, @accentLightTealHighlight);
}

.btn-striped-teal {
	.stripedButtonBorders(@accentTeal, @accentTealHighlight);
}

.btn-striped-light-blue {
	.stripedButtonBorders(@accentLightBlue, @accentLightBlueHighlight);
}

.btn-striped-blue {
	.stripedButtonBorders(@accentBlue, @accentBlueHighlight);
}

.btn-striped-dark-purple {
	.stripedButtonBorders(@accentDarkPurple, @accentDarkPurpleHighlight);
}

.btn-striped-purple {
	.stripedButtonBorders(@accentPurple, @accentPurpleHighlight);
}

